/**
 * 
 */
package com.feib.stms.service;

import java.util.Date;
import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.feib.stms.model.TempUploadFile;
import com.feib.stms.pagination.PaginatedList;


/**
 * @author Jimmy Liu
 *
 */
@Transactional(readOnly = true)
public interface TempUploadFileService 
{
	@Transactional(readOnly = false)
	public int addTempUploadFile(TempUploadFile tempUploadFile);

	/**
	 * 以檔名查詢暫存檔中檢查通過的檔案(Like 查詢)
	 * @param fileName 檔名
	 * @param excludePk 需排除的PK
	 * @return
	 */
	public List<TempUploadFile> findValidateFileByFileName(String fileName, Long excludePk);
	
	/**
	 * 查詢上傳檔案(暫存檔)紀錄
	 * @param tempUploadFile 查詢物件
	 * @param uploaddDateFrom 上傳日期起
	 * @param uploadDateTo 上傳日期迄
	 * @param fileFormats 上傳格式
	 * @param paginatedList 換頁與排序條件
	 * @return 查詢結果
	 */
	public PaginatedList<TempUploadFile> findPaginatedListByTempUploadFile(TempUploadFile tempUploadFile, Date uploaddDateFrom, Date uploadDateTo, List<String> fileFormats, PaginatedList<TempUploadFile> paginatedList);

	@Transactional(readOnly = false)
	public int deleteByPk(Long tempUploadFilePk);

	@Transactional(readOnly = false)
	public int updateImportStatus(TempUploadFile tempUploadFile);

	/**
	 * 以主鍵取得物件
	 * @param tempUploadFilePk
	 * @return
	 */
	public TempUploadFile findTempUploadFileByPk(Long tempUploadFilePk);

	/**
	 * 查詢可上傳的交割款檔案(含以上傳驗資檔)<BR/>
	 * 交割款上傳使用
	 * @param tempUploadFile
	 * @param uploaddDateFrom
	 * @param uploadDateTo
	 * @param paginatedList
	 * @return
	 */
	public PaginatedList<TempUploadFile> findPaginatedListByFormatIs2(
			TempUploadFile tempUploadFile, Date uploaddDateFrom,
			Date uploadDateTo, PaginatedList<TempUploadFile> paginatedList);

}
